cmake_minimum_required(VERSION 3.5)

SET(PROJECT_NAME "TokenEncrypt")
project(${PROJECT_NAME})

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -w")

macro(add_source soure_name soure_dir)
    include_directories(${soure_dir})
    set(hfind ${ARGV1})
    string(APPEND hfind "/*.h")
    set(cppfind ${ARGV1})
    string(APPEND cppfind "/*.cpp")
    file(GLOB name_header ${hfind})
    file(GLOB name_cpp ${cppfind})
    set(all_file ${all_file} ${name_header} ${name_cpp})
endmacro(add_source)

add_source(src ./)

add_library(${PROJECT_NAME} SHARED ${all_file})
target_link_libraries(${PROJECT_NAME} libcrypto.so libssl.so)
